home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Default Key Bindings < prev    next >
Encoding:
Text File  |  2000-11-30  |  12.0 KB  |  345 lines

  1.  
  2. Default Key Bindings
  3.  
  4.                                                version: 7.4
  5.                                                created: 03/08/94 {02:47:04 pm}
  6.                                            last update: 11/30/00 {07:31:11 pm}
  7.  
  8.  
  9.           Introduction
  10.  
  11.  
  12. There are basically three different ways editor functions can be invoked:
  13.  
  14.     • Directly via Alpha menus.
  15.     • Through menu equivalent key bindings
  16.     • Through key combinations other than menu equivalents. These 
  17.       combinations include function keys and the numeric keypad.
  18.  
  19. It is the last two options that we are concerned with in this document.  By
  20. default, Alpha has well over 300 different key bindings, far more than you
  21. would ever want to memorize.  However, the bindings are there only for your
  22. convenience.  You don't need to use any of them, but many people find that
  23. using the mouse for common editing functions seriously slows them down.
  24.  
  25. To quickly find out what a specific key is bound to, use the menu item
  26. "Config --> Describe Binding", and then press the key combination in
  27. question.  If you look closer at the "Config" menu, you'll also see that F7
  28. is bound to this menu item.  For example, type
  29.  
  30.     F7
  31.     <command>-S
  32.  
  33. and you'll see that command-S is bound to 
  34.  
  35.     menu::fileProc "File" "save" 
  36.  
  37. (command is the "Apple" key on the Macintosh, by the way, and "alt" on a PC)
  38.  
  39. Sometimes the information given by F7 will seem somewhat cryptic, because
  40. these are the actual Tcl commands, but in general it is easy to decipher
  41. what is going on.
  42.  
  43. If you take a look at the "File" menu, you'll see that "Save" also gives
  44. the key binding information -- if you find yourself using the same menu
  45. commands over and over again, learning a few of these bindings can save a
  46. lot of time and travel of the mouse.
  47.  
  48. The "Config --> List All Bindings" menu item will list all current key
  49. bindings, or you could just click here --> <<global::listAllBindings>>.  If
  50. you want more information regarding what an item does, command double-click
  51. on the listed Tcl procedure to open the file containing its definition.
  52.  
  53.  
  54.     ======================================================================
  55.  
  56.  
  57.           Global Key Bindings
  58.  
  59.  
  60. The following is a list of some of the most commonly used key bindings in
  61. Alpha's default setup, those that are generally not listed in any menus:
  62.  
  63.  
  64.                Help
  65.  
  66. 'help'                                    open the "Alpha Manual" help file
  67.  
  68.  
  69.                Moving the Cursor
  70.  
  71.  
  72. left-arrow           or  control-b      backward character
  73. right-arrow          or  control-f      forward character
  74. up-arrow             or  control-p      previous-line
  75. down-arrow           or  control-n      next-line
  76.  
  77. option-left-arrow    or  option-b       backward one word
  78. option-right-arrow   or  option-f       forward one word
  79.  
  80. command-left-arrow   or  control-a      beginning of line
  81. command-right-arrow  or  control-e      end of line
  82. command-up-arrow     or  'home'         beginning of window
  83. command-down-arrow   or  'end'          end of window
  84.  
  85. 'pgup'                                  move one page backward
  86. 'pgdn'                                  move one page forward
  87.  
  88.  
  89.                Selecting Text
  90.  
  91.  
  92. shift-left-arrow                        extend selection one char left
  93. shift-right-arrow                       extend selection one char right
  94.  
  95. shift-up-arrow                          extend selection one line up
  96. shift-down-arrow                        extend selection one line down
  97.  
  98. shift-option-left-arrow                 extend selection one word left
  99. shift-option-right-arrow                extend selection one word right
  100.  
  101. control-h                               select next word
  102.  
  103. shift-command-left-arrow                select to beginning of line
  104. shift-command-right-arrow               select to end of line
  105.  
  106.  
  107.                Deleting Text
  108.  
  109.  
  110. 'del'      or  control-d        delete forward char
  111. 'delete'                        delete backward char
  112. option-d                        delete forward word
  113. option-h   or  option-delete    delete backward word
  114. control-k                       delete to end of line
  115.  
  116.  
  117.                Twiddle, Shifting Text
  118.  
  119.  
  120. The following functions are found in the Text menu.
  121.  
  122. Twiddle (command-`)                  Exchange characters bracketing 
  123.                                      the selection point.
  124. Twiddle Words (command-option-`)     Exchange words bracketing the 
  125.                                      selection point.
  126.  
  127. Shift Left (command-[)               Shift selection left one tab.
  128. Shift Left Space (command-option-[)  Shift selection left one space.
  129. Shift Right (command-])              Shift selection right one tab.
  130. Shift Right Space (command-option-]) Shift selection right one space.
  131.  
  132.  
  133.                The Numeric Key Pad
  134.  
  135.  
  136. Alpha starts up with the Num Lock off so that the numeric key pad can be
  137. used as a navigation tool.
  138.  
  139. 0   Scroll back one page 
  140. 1   Jump to the start of the nearest function above the current position * 
  141. 2   No special function; types a "2" 
  142. 3   Jump to the start of the nearest function below the current position * 
  143. 4   Move to beginning of current word 
  144. 5   Marks current insertion point and moves cursor to previous mark. 
  145.  
  146.     Note: This is extremely useful for navigating across text chunks.  Try
  147.     'paste'-ing a large chunk of text, and then immediately hit Keypad 5.  
  148.  
  149.     Try 'put cursor at top/bottom of document' (Keypad 0 or .), and then
  150.     immediately hit Keypad 5.  After a few minutes, you won't be able to
  151.     live without Keypad 5...
  152.  
  153. 6   Move to end of current word 
  154. 7   Delete all characters from current insertion point to beginning of word 
  155. 8   Put cursor at top of document (new in 7.4.x) 
  156. 9   Delete all characters from current insertion point to end of word 
  157.  
  158. .   Put cursor at bottom of document 
  159. +   Cycles between the two topmost windows 
  160. -   Makes the previous window topmost 
  161.  
  162. shift-clear   Turns num lock off, allowing you to use the keypad for numbers
  163. clear         Move the current line to the top of the window
  164. enter         Page forward 
  165.  
  166. * Note: in modes where no function specifying pattern exist, 1 and 3 just
  167. look for parenthesis (e.g. text mode).  Also, in Tcl trace dumps these keys
  168. help follow Tcl calls and returned values (advanced stuff)
  169.  
  170. The =, /, * keys function normally.
  171.  
  172. To turn off these special navigation functions, turn on the Num Lock (using 
  173. shift-clear).
  174.  
  175. Turning the Num Lock off will recover the navigation features of the
  176. numeric key pad.
  177.  
  178.  
  179.     ======================================================================
  180.  
  181.  
  182.           Mode Specific Bindings
  183.  
  184.  
  185. Be aware that each file has a "mode" associated with it that may define
  186. additional key bindings.  The "Config --> Mode Prefs --> Describe Mode"
  187. menu item will list mode-specific key bindings (for the mode of the current
  188. window).
  189.  
  190. LaTeX specific key bindings can also be found in "latexKeys.tcl".
  191.  
  192.  
  193.     ======================================================================
  194.  
  195.  
  196.           User Defined Key bindings
  197.         
  198.  
  199. Any Tcl command can be bound to any single keystroke. One way to bind a 
  200. function is with a statement such as:
  201.   
  202.     Bind 'c' <modifier string> funcName [<mode>]
  203.           
  204. where c is a character, <modifier string> is an optional string containing 
  205. one or more of:
  206.  
  207.       c   - command modifier
  208.       o   - option modifier
  209.       s   - shift modifier
  210.       z   - control modifier
  211.       e   - escape modifier      
  212.  
  213. 'mode' is an optional parameter that specifies, when present, that the
  214. binding is only active in a given mode.  Note that given a general binding
  215. (no mode specification) and a binding specific to the current mode, the
  216. last binding to have been created is the one found first.
  217.  
  218. For example, the following line binds cmd-shift-f to the function
  219. 'forwardChar':
  220.  
  221.     Bind 'f' <cs> forwardChar
  222.  
  223. Additionally, the modifier string can contain a capital letter specifying
  224. that the binding is only activated if preceded by control and the lowercase
  225. version of that letter.  This feature allows multiple-key combinations a la
  226. Emacs.  This requires that ctrl-<the character> is bound to the function
  227. 'prefixChar'.  By default ctrl-C, ctrl-Q, and ctrl-X are bound to
  228. 'prefixChar'.  The next line would bind 'forwardChar' to ctrl-x ctrl-f:
  229.  
  230.     Bind 'f' <cX> forwardChar 
  231.  
  232. Additionally, most keyboards have keypads and/or function keys.  These keys
  233. can be bound using case-insensitive numeric labels using the same bind
  234. command as above, with the label replacing the character.  For example, to
  235. bind F1 to function 'funcName', the following would work:
  236.  
  237.     Bind F1 funcName
  238.  
  239. As above, the binding can include a modifier string.  The following labels
  240. are defined:
  241.  
  242.   Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 Help Home Pgup Del 
  243.   End Pgdn Left Right Up Down Clear Kpad0 Kpad1 Kpad2 Kpad3 Kpad4 Kpad5
  244.   Kpad6 Kpad7 Kpad8 Kpad9 Kpad= Kpad/ Kpad* Kpad- Kpad+ Enter Kpad.
  245.  
  246. The above labels may not be sufficient for all keyboards (attention
  247. international users).  In particular there are some problems when binding
  248. to accented characters (more about that below).  If a hex number is used
  249. instead of a character inside the single quotes, the binding is done to key
  250. codes instead of ascii values.  The following is a key code version of the
  251. same binding:
  252.  
  253.     Bind 0x03 <cs> forwardChar
  254.  
  255. The key code for any given key can be obtained by selecting the menu item
  256. "Utils --> Ascii Etc --> Key Code" and then typing the key.  Alpha then
  257. types the key code.
  258.  
  259. Also, there is an alternate form that allows the specification of an ascii
  260. code directly:
  261.  
  262.     ascii 0x20 <z> setMark
  263.     
  264. Binds control-space to 'setMark'.  The ascii code for any given key can be
  265. obtained by selecting the menu item "Utils --> Ascii Etc --> Key Ascii" and
  266. then typing the key.  Alpha then types the ascii code.
  267.  
  268. Note that menu item command equivalents take precedence over bindings, and
  269. that the 'Bind' command does not affect the command equivalents displayed
  270. in the menus.  Also note that key code bindings take precedence over ascii
  271. bindings.
  272.  
  273. Finally, there are 'unBind' and 'unascii' functions, with identical
  274. arguments to their counterparts.
  275.  
  276.  
  277.                Bindings to accented characters
  278.  
  279.  
  280. To bind to an accented character is not always as straight forward as
  281. binding to an un-accented one.
  282.  
  283. Accented characters which can be typed directly without using a dead key,
  284. you can bind to them as long as they have a modifier different from <s>. 
  285. As an example with a French keyboard
  286.  
  287.     Bind 'é' <c> ...
  288.     Bind 'é' <z> ...
  289.     
  290. works fine, but
  291.  
  292.     Bind 'é' ...
  293.     Bind 'é' <s> ...
  294.     
  295. does not. In the latter case the key code has to be used instead:
  296.  
  297.     Bind 0x13 ...
  298.     Bind 0x13 <s> ...
  299.  
  300. Accented characters which are obtained using a dead key has to be bound
  301. using ascii, e.g 'ì' on a French keyboard:
  302.  
  303.     ascii 0x93 ...
  304.  
  305.  
  306.                What to bind to?
  307.  
  308.  
  309. When you want to define a new key binding you obviously want to use a key
  310. combination which is not already in use.  There are two different ways to
  311. find if a key combination is free.
  312.  
  313. First, the menu item "Config --> List All Bindings" will list all of the
  314. bindings currently in effect.
  315.  
  316. Second, you can use "Config --> Describe Binding" to find what a certain
  317. key combination is bound to.  Select "Config --> Describe Binding" and then
  318. hit the key combination you are interested in.  Alpha will then display a
  319. dialog saying which function the key combination is bound to, or "Key
  320. combination unbound."  if it is not bound to anything.
  321.  
  322. There is one thing to note about bindings involving the shift key.  If
  323. there is nothing bound to a key combination including the shift key, typing
  324. this key combination will have the same effect as the one wihout the shift
  325. key.  A specific example to clarify this: command-P is bound to "print",
  326. but there is no binding defined for command-shift-P. Still hitting
  327. command-shift-P has the same effect as hitting command-P. But if you now
  328. define a new binding for command-shift-P, then command-P and
  329. command-shift-P will have different functionality.
  330.  
  331.  
  332.     ======================================================================
  333.  
  334.  
  335. Author: Pete Keheler
  336.  
  337. Default Key Bindings updated by Craig Barton Upright, Donavan Hall.
  338.  
  339. E-mail: <cupright@princeton.edu>
  340.   mail: Princeton University,  Department of Sociology 
  341.         Princeton, New Jersey  08544  USA
  342.    www: <http://www.princeton.edu/~cupright/>
  343.  
  344. E-mail: <hall@magnet.fsu.edu>
  345.